package
{
	import flash.display.MovieClip;

	public class NinjaEditor
	{
		public var levStr:String;
		public var mapStr:String;
		public var objStr:String;
		public var rend:VectorRenderer;
		public var objList:Array;
		public var objnum:Number;
		public var pointer:MovieClip;
		public var objMenuMC:MovieClip;
		public var tileMenuMC:MovieClip;
		public var setObjTypeKeys:Object;
		public var currentEOBJTYPE:Number;
		public var currentOBJTYPE:Number;
		public var objTypes:Object;
		public var tileTypeList:Object;
		public var tileCurType:int;
		public var MUST_BUILD_EDIT_OBJS:Boolean;
		public var editObjStep:Number;
		public var Tick:Function;

		public function NinjaEditor()
		{
			this.levStr = "";
			this.mapStr = "";
			this.objStr = "";
			this.rend = new VectorRenderer();
			this.objList = new Array();
			this.objnum = 0;
			this.pointer = Main.getInstance().gfx.CreateSprite("editorCursor", NinjaGraphicsSystem.LAYER_EDITOR);
			this.pointer.visible = false;
			this.objMenuMC = Main.getInstance().gfx.CreateSprite("editorObjMenuMC", NinjaGraphicsSystem.LAYER_EDITOR);
			this.objMenuMC.x = 0;
			this.objMenuMC.y = 0;
			this.objMenuMC.visible = false;
			this.tileMenuMC = Main.getInstance().gfx.CreateSprite("editorTileMenuMC", NinjaGraphicsSystem.LAYER_EDITOR);
			this.tileMenuMC.x = 100;
			this.tileMenuMC.y = 0;
			this.tileMenuMC.visible = false;
			this.setObjTypeKeys = new Object();
			this.setObjTypeKeys[NinjaEditor.EOBJTYPE_GOLD] = 48;
			this.setObjTypeKeys[NinjaEditor.EOBJTYPE_BOUNCEBLOCK] = 189;
			this.setObjTypeKeys[NinjaEditor.EOBJTYPE_LAUNCHPAD] = 187;
			this.setObjTypeKeys[NinjaEditor.EOBJTYPE_TURRET] = 49;
			this.setObjTypeKeys[NinjaEditor.EOBJTYPE_FLOORGUARD] = 52;
			this.setObjTypeKeys[NinjaEditor.EOBJTYPE_PLAYER] = 57;
			this.setObjTypeKeys[NinjaEditor.EOBJTYPE_MINE] = 51;
			this.setObjTypeKeys[NinjaEditor.EOBJTYPE_ONEWAYPLATFORM] = 219;
			this.setObjTypeKeys[NinjaEditor.EOBJTYPE_THWOMP] = 53;
			this.setObjTypeKeys[NinjaEditor.EOBJTYPE_EXIT] = 221;
			this.setObjTypeKeys[NinjaEditor.EOBJTYPE_HOMINGLAUNCHER] = 50;
			this.setObjTypeKeys[NinjaEditor.EOBJTYPE_TREKDOOR] = 73;
			this.setObjTypeKeys[NinjaEditor.EOBJTYPE_LOCKDOOR] = 79;
			this.setObjTypeKeys[NinjaEditor.EOBJTYPE_TRAPDOOR] = 80;
			this.setObjTypeKeys[NinjaEditor.EOBJTYPE_ZAPDRONE] = 54;
			this.setObjTypeKeys[NinjaEditor.EOBJTYPE_LASERDRONE] = 55;
			this.setObjTypeKeys[NinjaEditor.EOBJTYPE_CHAINGUNDRONE] = 56;
			this.currentEOBJTYPE = NinjaEditor.EOBJTYPE_GOLD;
			this.currentOBJTYPE = ObjectManager.OBJTYPE_GOLD;
			this.objTypes = new Object();
			this.objTypes[NinjaEditor.EOBJTYPE_GOLD] = ObjectManager.OBJTYPE_GOLD;
			this.objTypes[NinjaEditor.EOBJTYPE_BOUNCEBLOCK] = ObjectManager.OBJTYPE_BOUNCEBLOCK;
			this.objTypes[NinjaEditor.EOBJTYPE_LAUNCHPAD] = ObjectManager.OBJTYPE_LAUNCHPAD;
			this.objTypes[NinjaEditor.EOBJTYPE_TURRET] = ObjectManager.OBJTYPE_TURRET;
			this.objTypes[NinjaEditor.EOBJTYPE_FLOORGUARD] = ObjectManager.OBJTYPE_FLOORGUARD;
			this.objTypes[NinjaEditor.EOBJTYPE_PLAYER] = ObjectManager.OBJTYPE_PLAYER;
			this.objTypes[NinjaEditor.EOBJTYPE_MINE] = ObjectManager.OBJTYPE_MINE;
			this.objTypes[NinjaEditor.EOBJTYPE_ONEWAYPLATFORM] = ObjectManager.OBJTYPE_ONEWAYPLATFORM;
			this.objTypes[NinjaEditor.EOBJTYPE_THWOMP] = ObjectManager.OBJTYPE_THWOMP;
			this.objTypes[NinjaEditor.EOBJTYPE_EXIT] = ObjectManager.OBJTYPE_EXIT;
			this.objTypes[NinjaEditor.EOBJTYPE_HOMINGLAUNCHER] = ObjectManager.OBJTYPE_HOMINGLAUNCHER;
			this.objTypes[NinjaEditor.EOBJTYPE_TREKDOOR] = ObjectManager.OBJTYPE_TESTDOOR;
			this.objTypes[NinjaEditor.EOBJTYPE_LOCKDOOR] = ObjectManager.OBJTYPE_TESTDOOR;
			this.objTypes[NinjaEditor.EOBJTYPE_TRAPDOOR] = ObjectManager.OBJTYPE_TESTDOOR;
			this.objTypes[NinjaEditor.EOBJTYPE_ZAPDRONE] = ObjectManager.OBJTYPE_DRONE;
			this.objTypes[NinjaEditor.EOBJTYPE_LASERDRONE] = ObjectManager.OBJTYPE_DRONE;
			this.objTypes[NinjaEditor.EOBJTYPE_CHAINGUNDRONE] = ObjectManager.OBJTYPE_DRONE;
			this.tileTypeList = new Object();
			this.tileTypeList[1] = new Array(TileMapCell.TID_45DEGnn, TileMapCell.TID_45DEGnp, TileMapCell.TID_45DEGpp, TileMapCell.TID_45DEGpn);
			this.tileTypeList[2] = new Array(TileMapCell.TID_67DEGnnS, TileMapCell.TID_67DEGnpS, TileMapCell.TID_67DEGppS, TileMapCell.TID_67DEGpnS);
			this.tileTypeList[3] = new Array(TileMapCell.TID_22DEGnnS, TileMapCell.TID_22DEGnpS, TileMapCell.TID_22DEGppS, TileMapCell.TID_22DEGpnS);
			this.tileTypeList[4] = new Array(TileMapCell.TID_CONCAVEnn, TileMapCell.TID_CONCAVEnp, TileMapCell.TID_CONCAVEpp, TileMapCell.TID_CONCAVEpn);
			this.tileTypeList[5] = new Array(TileMapCell.TID_HALFl, TileMapCell.TID_HALFd, TileMapCell.TID_HALFr, TileMapCell.TID_HALFu);
			this.tileTypeList[6] = new Array(TileMapCell.TID_67DEGnnB, TileMapCell.TID_67DEGnpB, TileMapCell.TID_67DEGppB, TileMapCell.TID_67DEGpnB);
			this.tileTypeList[7] = new Array(TileMapCell.TID_22DEGnnB, TileMapCell.TID_22DEGnpB, TileMapCell.TID_22DEGppB, TileMapCell.TID_22DEGpnB);
			this.tileTypeList[8] = new Array(TileMapCell.TID_CONVEXnn, TileMapCell.TID_CONVEXnp, TileMapCell.TID_CONVEXpp, TileMapCell.TID_CONVEXpn);
			this.tileCurType = 1;
			this.MUST_BUILD_EDIT_OBJS = false;
		}

		//
		public static const EOBJTYPE_GOLD:int = 0;
		public static const EOBJTYPE_BOUNCEBLOCK:int = 1;
		public static const EOBJTYPE_LAUNCHPAD:int = 2;
		public static const EOBJTYPE_TURRET:int = 3;
		public static const EOBJTYPE_FLOORGUARD:int = 4;
		public static const EOBJTYPE_PLAYER:int = 5;
		public static const EOBJTYPE_MINE:int = 6;
		public static const EOBJTYPE_ONEWAYPLATFORM:int = 7;
		public static const EOBJTYPE_THWOMP:int = 8;
		public static const EOBJTYPE_EXIT:int = 9;
		public static const EOBJTYPE_HOMINGLAUNCHER:int = 10;
		public static const EOBJTYPE_TREKDOOR:int = 11;
		public static const EOBJTYPE_LOCKDOOR:int = 12;
		public static const EOBJTYPE_TRAPDOOR:int = 13;
		public static const EOBJTYPE_ZAPDRONE:int = 14;
		public static const EOBJTYPE_LASERDRONE:int = 15;
		public static const EOBJTYPE_CHAINGUNDRONE:int = 16;

		public function Start():void
		{
			this.MUST_BUILD_EDIT_OBJS = true;
			for (var _local2 in this.objList)
			{
				this.objList[_local2][NinjaEditor.EDITRECORD_MC].visible = true;
				this.objList[_local2][NinjaEditor.EDITRECORD_MC2].visible = true;
			}
			this.StartEditMenu();
		}

		public function Exit():void
		{
			this.rend.Clear();
			this.pointer.visible = false;
			this.objMenuMC.visible = false;
			this.tileMenuMC_visible = false;
			this.SetTxtBox(this.DumpData());
			this.MUST_BUILD_EDIT_OBJS = false;
			this.SpawnGameObjects();
			for (var _local3 in this.objList)
			{
				this.objList[_local3][NinjaEditor.EDITRECORD_MC].visible = false;
				this.objList[_local3][NinjaEditor.EDITRECORD_MC2].visible = false;
			}
			var _local2;
			for (var _local3 in this.objList)
			{
				_local2 = this.objList.pop();
				Main.getInstance().gfx.DestroyMC(_local2[NinjaEditor.EDITRECORD_MC]);
				Main.getInstance().gfx.DestroyMC(_local2[NinjaEditor.EDITRECORD_MC2]);
			}
		}

		public function SetTxtBox(str):void
		{
			Main.getInstance().gui.SetTxt(NinjaGUI.TXTBOX_TOP, str);
		}

		public function GetTxtBox()
		{
			return Main.getInstance().gui.GetTxt(NinjaGUI.TXTBOX_TOP);
		}

		public function DumpData()
		{
			this.SpawnGameObjects();
			var _local1 = Main.getInstance().game.DumpLevelData();
			Main.getInstance().objects.Clear();
			return(_local1);
		}

		public function LoadData(levStr):void
		{
			this.MUST_BUILD_EDIT_OBJS = true;
			Main.getInstance().App_LoadLevel_Raw(levStr, Main.getInstance().App_StartEditor);
		}

		public function LoadObjData(objStr)
		{
			var _local3;
			for (var i in this.objList)
			{
				_local3 = this.objList.pop();
				Main.getInstance().gfx.DestroyMC(_local3[NinjaEditor.EDITRECORD_MC]);
				Main.getInstance().gfx.DestroyMC(_local3[NinjaEditor.EDITRECORD_MC2]);
			}
			Main.getInstance().objects.Clear();
			this.objStr = objStr;
			var oStrArray;
			if (0 < this.objStr.length)
			{
				oStrArray = this.objStr.split(NinjaGame.OBJECT_SEPERATION_CHAR);
				this.CURRENT_OBJ_LOADING = 0;
			}
			else
			{
				this.CURRENT_OBJ_LOADING = 0;
				return;
			}
			while (this.CURRENT_OBJ_LOADING < oStrArray.length)
			{
				_local3 = oStrArray[this.CURRENT_OBJ_LOADING].split(NinjaGame.OBJTYPE_SEPERATION_CHAR);
				var _local1 = _local3[1].split(NinjaGame.OBJPARAM_SEPERATION_CHAR);
				for (var i in _local1)
				{
					_local1[i] = Number(_local1[i]);
				}
				this.BuildEditObj(Number(_local3[0]), _local1);
				this.CURRENT_OBJ_LOADING++;
			}
		}

		public function StartEditMenu()
		{
			this.StopEdit();
			this.Tick = this.TickEditMenu;
			Main.getInstance().gui.Display(NinjaGUI.GUI_TEMP_EDITOR);
		}

		public function TickEditMenu():void
		{
			if (this.MUST_BUILD_EDIT_OBJS)
			{
				this.MUST_BUILD_EDIT_OBJS = false;
				this.LoadObjData(Main.getInstance().game.DumpObjData());
			}
			if (KeyManager.isDown(192) || (KeyManager.isDown(220)))
			{
				Main.getInstance().APP_KEY_TRIG = false;
				this.Exit();
				var _local2 = Main.getInstance().gui.GetTxt(NinjaGUI.TXTBOX_TOP);
				Main.getInstance().App_LoadLevel_Raw(_local2, Main.getInstance().App_StartDebugMenu);
			}
			else if (KeyManager.isDown(33))
			{
				this.LoadData(this.GetTxtBox());
			}
			else if (KeyManager.isDown(34))
			{
				this.SetTxtBox(this.DumpData());
			}
			else if (KeyManager.isDown(45))
			{
				this.StopEdit();
				this.StartEditObjects();
			}
			else if (KeyManager.isDown(46))
			{
				this.StopEdit();
				this.StartEditTiles();
			}
		}

		public function StartEditTiles():void
		{
			Main.getInstance().gui.Display(NinjaGUI.GUI_TILE_EDITOR);
			Main.getInstance().gui.HideTxt();
			this.tileCurType = 1;
			this.pointer.txt = "";
			this.pointer.visible = false;
			this.objMenuMC.visible = false;
			this.tileMenuMC.visible = true;
			this.tileMenuMC.gotoAndStop(1);
			this.pointer.objhelp.visible = false;
			this.RefreshTileMenu();
			this.Tick = this.TickEditTiles;
			this.StopEdit = this.StopEditTiles;
		}

		public function StopEditTiles():void
		{
			this.pointer.visible = false;
			this.objMenuMC.visible = false;
			this.tileMenuMC.visible = false;
		}

		public function RefreshTileMenu():void
		{
			var _local1 = Main.getInstance().input.getMousePos();
			if (_local1.y < 300)
			{
				this.tileMenuMC.y = 450;
			}
			else
			{
				this.tileMenuMC.y = 150;
			}
		}

		public function TickEditTiles():void
		{
			if (KeyManager.isDown(36))
			{
				this.StartEditMenu();
			}
			else
			{
				if (KeyManager.isDown(45))
				{
					this.StopEdit();
					this.StartEditObjects();
				}
				var m = Main.getInstance().input.getMousePos();
				var _local2 = Main.getInstance().tiles.GetTile_V(m);
				this.rend.Clear();
				this.rend.SetStyle(0, 0, 30);
				this.rend.DrawAABB(_local2.pos, _local2.xw, _local2.yw);
				var cursor = new Vector2(m.x, m.y);
				this.pointer.x = cursor.x;
				this.pointer.y = cursor.y;
				this.RefreshTileMenu();
				if (KeyManager.isDown(49))
				{
					this.tileCurType = 1;
				}
				else if (KeyManager.isDown(50))
				{
					this.tileCurType = 2;
				}
				else if (KeyManager.isDown(51))
				{
					this.tileCurType = 3;
				}
				else if (KeyManager.isDown(52))
				{
					this.tileCurType = 4;
				}
				else if (KeyManager.isDown(53))
				{
					this.tileCurType = 5;
				}
				else if (KeyManager.isDown(54))
				{
					this.tileCurType = 6;
				}
				else if (KeyManager.isDown(55))
				{
					this.tileCurType = 7;
				}
				else if (KeyManager.isDown(56))
				{
					this.tileCurType = 8;
				}
				if (KeyManager.isDown(16))
				{
					if (this.tileCurType <= 4)
					{
						var _local3 = this.tileCurType + 4;
					}
					else
					{
						var _local3 = this.tileCurType - 4;
					}
				}
				else
				{
					var _local3 = this.tileCurType;
				}
				this.tileMenuMC.gotoAndStop(_local3);
				if (KeyManager.isDown(68))
				{
					_local2.Clear();
				}
				else if (KeyManager.isDown(69))
				{
					_local2.SetState(TileMapCell.TID_FULL);
				}
				else if (KeyManager.isDown(81))
				{
					_local2.SetState(this.tileTypeList[_local3][0]);
				}
				else if (KeyManager.isDown(65))
				{
					_local2.SetState(this.tileTypeList[_local3][1]);
				}
				else if (KeyManager.isDown(83))
				{
					_local2.SetState(this.tileTypeList[_local3][2]);
				}
				else if (KeyManager.isDown(87))
				{
					_local2.SetState(this.tileTypeList[_local3][3]);
				}
			}
		}

		public function StartEditObjects():void
		{
			Main.getInstance().gui.Display(NinjaGUI.GUI_OBJ_EDITOR);
			Main.getInstance().gui.HideTxt();
			this.objSnapTo = Main.getInstance().tiles.xw;
			this.pointer.txt = "(1/2 snap)";
			this.pointer.visible = true;
			this.objMenuMC.visible = true;
			this.tileMenuMC.visible = false;
			this.pointer.objhelp.gotoAndStop(1);
			this.pointer.objhelp.visible = true;
			this.pointer.tilehelp.visible = false;
			this.Tick = this.TickEditObjects;
			this.StopEdit = this.StopEditObjects;
			this.RefreshObjMenu();
		}

		public function StopEditObjects():void
		{
			this.pointer.visible = false;
			this.objMenuMC.visible = false;
			this.tileMenuMC.visible = false;
		}

		public function RefreshObjMenu():void
		{
			var _local2 = Main.getInstance().input.getMousePos();
			if (_local2.x < 400)
			{
				this.objMenuMC.x = 400;
			}
			else
			{
				this.objMenuMC.x = 0;
			}
			if (_local2.y < 300)
			{
				this.objMenuMC.y = 450;
			}
			else
			{
				this.objMenuMC.y = 150;
			}
		}

		public function TickEditObjects():void
		{
			if (KeyManager.isDown(36))
			{
				this.StartEditMenu();
			}
			else
			{
				if (KeyManager.isDown(46))
				{
					this.StopEdit();
					this.StartEditTiles();
				}
				var m = Main.getInstance().input.getMousePos();
				if (KeyManager.isDown(90))
				{
					this.objSnapTo = 1;
					this.pointer.txt = "(no snap)";
				}
				else if (KeyManager.isDown(88))
				{
					this.objSnapTo = Main.getInstance().tiles.xw;
					this.pointer.txt = "(1/2 snap)";
				}
				else if (KeyManager.isDown(67))
				{
					this.objSnapTo = Main.getInstance().tiles.xw * 0.5;
					this.pointer.txt = "(1/4 snap)";
				}
				var _local2 = new Vector2(Math.round(m.x / this.objSnapTo) * this.objSnapTo, Math.round(m.y / this.objSnapTo) * this.objSnapTo);
				this.pointer.x = _local2.x;
				this.pointer.y = _local2.y;
				var temp = Main.getInstance().tiles.GetTile_V(_local2);
				this.rend.Clear();
				this.rend.SetStyle(0, 0, 30);
				this.rend.DrawAABB(temp.pos, temp.xw, temp.yw);
				this.RefreshObjMenu();
				for (var i in this.setObjTypeKeys)
				{
					if (KeyManager.isDown(this.setObjTypeKeys[i]))
					{
						this.currentEOBJTYPE = Number(i);
						this.currentOBJTYPE = this.objTypes[i];
						this.editObjStep = 0;
						this.pointer.objhelp.gotoAndStop(this.currentEOBJTYPE + 1);
						break;
					}
				}
				if (Main.getInstance().input.MousePressed())
				{
					if (KeyManager.isDown(8))
					{
						this.KillNearestObj(m);
						return;
					}
					else if (KeyManager.isDown(220))
					{
						this.KillMostRecentObj();
						return;
					}
					params = null;
					var _local3 = 2;
					var params = new Array();
					params[0] = _local2.x;
					params[1] = _local2.y;
					if (this.currentEOBJTYPE == NinjaEditor.EOBJTYPE_FLOORGUARD)
					{
						if (KeyManager.isDown(65))
						{
							params[2] = -1;
						}
						else if (KeyManager.isDown(68))
						{
							params[2] = 1;
						}
						else
						{
							return;
						}
						_local3 = 3;
					}
					else if (this.currentEOBJTYPE == NinjaEditor.EOBJTYPE_ONEWAYPLATFORM)
					{
						if (KeyManager.isDown(83))
						{
							params[2] = DroneObject.AI_DIR_D;
						}
						else if (KeyManager.isDown(87))
						{
							params[2] = DroneObject.AI_DIR_U;
						}
						else if (KeyManager.isDown(65))
						{
							params[2] = DroneObject.AI_DIR_L;
						}
						else if (KeyManager.isDown(68))
						{
							params[2] = DroneObject.AI_DIR_R;
						}
						else
						{
							return;
						}
						_local3 = 3;
					}
					else if (this.currentEOBJTYPE == NinjaEditor.EOBJTYPE_THWOMP)
					{
						if (KeyManager.isDown(83))
						{
							params[2] = DroneObject.AI_DIR_D;
						}
						else if (KeyManager.isDown(87))
						{
							params[2] = DroneObject.AI_DIR_U;
						}
						else if (KeyManager.isDown(65))
						{
							params[2] = DroneObject.AI_DIR_L;
						}
						else if (KeyManager.isDown(68))
						{
							params[2] = DroneObject.AI_DIR_R;
						}
						else
						{
							return;
						}
						_local3 = 3;
					}
					else if (this.currentEOBJTYPE == NinjaEditor.EOBJTYPE_LAUNCHPAD)
					{
						var dx = 0;
						var dy = 0;
						if (KeyManager.isDown(87))
						{
							dy = -1;
						}
						else if (KeyManager.isDown(83))
						{
							dy = 1;
						}
						if (KeyManager.isDown(65))
						{
							dx = -1;
						}
						else if (KeyManager.isDown(68))
						{
							dx = 1;
						}
						var len = Math.sqrt((dx * dx) + (dy * dy));
						if (len == 0)
						{
							return;
						}
						else
						{
							dx = dx / len;
							dy = dy / len;
							params[2] = dx;
							params[3] = dy;
						}
						_local3 = 4;
					}
					else if (this.currentEOBJTYPE == NinjaEditor.EOBJTYPE_EXIT)
					{
						if (this.editObjStep == 0)
						{
							this.editObjStepVar0 = new Vector2(_local2.x, _local2.y);
							this.editObjStep = 1;
							this.pointer.objhelp.gotoAndStop(18);
							return;
						}
						else if (this.editObjStep == 1)
						{
							params[0] = this.editObjStepVar0.x;
							params[1] = this.editObjStepVar0.y;
							params[2] = _local2.x;
							params[3] = _local2.y;
							this.pointer.objhelp.gotoAndStop(10);
							_local3 = 4;
						}
					}
					else if (this.currentEOBJTYPE == NinjaEditor.EOBJTYPE_TREKDOOR)
					{
						var c = Main.getInstance().tiles.GetTile_V(_local2);
						params[4] = c.i;
						params[5] = c.j;
						params[3] = 0;
						params[0] = _local2.x;
						params[1] = _local2.y;
						params[6] = 0;
						if (KeyManager.isDown(83))
						{
							params[2] = 1;
							params[7] = 0;
							params[8] = 0;
						}
						else if (KeyManager.isDown(68))
						{
							params[2] = 0;
							params[7] = 0;
							params[8] = 0;
						}
						else if (KeyManager.isDown(65))
						{
							params[7] = -1;
							params[8] = 0;
							params[2] = 0;
						}
						else if (KeyManager.isDown(87))
						{
							params[7] = 0;
							params[8] = -1;
							params[2] = 1;
						}
						else
						{
							return;
						}
						_local3 = 9;
					}
					else if (this.currentEOBJTYPE == NinjaEditor.EOBJTYPE_LOCKDOOR)
					{
						var c = Main.getInstance().tiles.GetTile_V(_local2);
						params[4] = c.i;
						params[5] = c.j;
						params[3] = 0;
						params[6] = 1;
						if (this.editObjStep == 0)
						{
							this.editObjStepVar0 = new Vector2(params[4], params[5]);
							this.editObjStepVarX = new Vector2(0, 0);
							this.editObjStep = 1;
							if (KeyManager.isDown(83))
							{
								this.editObjStepVar1 = 1;
							}
							else if (KeyManager.isDown(68))
							{
								this.editObjStepVar1 = 0;
							}
							else if (KeyManager.isDown(65))
							{
								this.editObjStepVarX.x = -1;
								this.editObjStepVar1 = 0;
							}
							else if (KeyManager.isDown(87))
							{
								this.editObjStepVarX.y = -1;
								this.editObjStepVar1 = 1;
							}
							else
							{
								this.editObjStep = 0;
								return;
							}
							this.pointer.objhelp.gotoAndStop(19);
							return;
						}
						else if (this.editObjStep == 1)
						{
							params[4] = this.editObjStepVar0.x;
							params[5] = this.editObjStepVar0.y;
							params[7] = this.editObjStepVarX.x;
							params[8] = this.editObjStepVarX.y;
							params[2] = this.editObjStepVar1;
							params[0] = _local2.x;
							params[1] = _local2.y;
							this.pointer.objhelp.gotoAndStop(13);
							_local3 = 9;
						}
					}
					else if (this.currentEOBJTYPE == NinjaEditor.EOBJTYPE_TRAPDOOR)
					{
						var c = Main.getInstance().tiles.GetTile_V(_local2);
						params[4] = c.i;
						params[5] = c.j;
						params[3] = 1;
						params[6] = 0;
						if (this.editObjStep == 0)
						{
							this.editObjStepVar0 = new Vector2(params[4], params[5]);
							this.editObjStepVarX = new Vector2(0, 0);
							this.editObjStep = 1;
							if (KeyManager.isDown(83))
							{
								this.editObjStepVar1 = 1;
							}
							else if (KeyManager.isDown(68))
							{
								this.editObjStepVar1 = 0;
							}
							else if (KeyManager.isDown(65))
							{
								this.editObjStepVarX.x = -1;
								this.editObjStepVar1 = 0;
							}
							else if (KeyManager.isDown(87))
							{
								this.editObjStepVarX.y = -1;
								this.editObjStepVar1 = 1;
							}
							else
							{
								this.editObjStep = 0;
								return;
							}
							this.pointer.objhelp.gotoAndStop(20);
							return;
						}
						else if (this.editObjStep == 1)
						{
							params[4] = this.editObjStepVar0.x;
							params[5] = this.editObjStepVar0.y;
							params[2] = this.editObjStepVar1;
							params[7] = this.editObjStepVarX.x;
							params[8] = this.editObjStepVarX.y;
							params[0] = _local2.x;
							params[1] = _local2.y;
							this.pointer.objhelp.gotoAndStop(14);
							_local3 = 9;
						}
					}
					else if (this.currentEOBJTYPE == NinjaEditor.EOBJTYPE_ZAPDRONE)
					{
						if (this.editObjStep == 0)
						{
							if (KeyManager.isDown(81))
							{
								var movetype = DroneObject.DRONEMOVE_SURFACEFOLLOW_CCW;
							}
							else if (KeyManager.isDown(69))
							{
								var movetype = DroneObject.DRONEMOVE_SURFACEFOLLOW_CW;
							}
							else if (KeyManager.isDown(87))
							{
								var movetype = DroneObject.DRONEMOVE_WANDER_ALTERNATING;
							}
							else if (KeyManager.isDown(83))
							{
								var movetype = DroneObject.DRONEMOVE_WANDER_RANDOM;
							}
							else if (KeyManager.isDown(65))
							{
								var movetype = DroneObject.DRONEMOVE_WANDER_CCW;
							}
							else if (KeyManager.isDown(68))
							{
								var movetype = DroneObject.DRONEMOVE_WANDER_CW;
							}
							else
							{
								return;
							}
							this.editObjStepVar0 = movetype;
							this.editObjStep = 1;
							this.pointer.objhelp.gotoAndStop(21);
							return;
						}
						else if (this.editObjStep == 1)
						{
							if (KeyManager.isDown(68))
							{
								var dir = DroneObject.AI_DIR_R;
							}
							else if (KeyManager.isDown(65))
							{
								var dir = DroneObject.AI_DIR_L;
							}
							else if (KeyManager.isDown(87))
							{
								var dir = DroneObject.AI_DIR_U;
							}
							else if (KeyManager.isDown(83))
							{
								var dir = DroneObject.AI_DIR_D;
							}
							else
							{
								this.editObjStep = 0;
								this.pointer.objhelp.gotoAndStop(15);
								return;
							}
							this.editObjStepVar1 = dir;
							this.editObjStep = 2;
							this.pointer.objhelp.gotoAndStop(22);
							return;
						}
						else if (this.editObjStep == 2)
						{
							if (KeyManager.isDown(32))
							{
								var ischase = 1;
							}
							else
							{
								var ischase = 0;
							}
							params[2] = this.editObjStepVar0;
							params[3] = ischase;
							params[4] = DroneObject.DRONEWEAP_ZAP;
							params[5] = this.editObjStepVar1;
							this.pointer.objhelp.gotoAndStop(15);
							_local3 = 6;
						}
					}
					else if (this.currentEOBJTYPE == NinjaEditor.EOBJTYPE_LASERDRONE)
					{
						if (this.editObjStep == 0)
						{
							if (KeyManager.isDown(81))
							{
								var movetype = DroneObject.DRONEMOVE_SURFACEFOLLOW_CCW;
							}
							else if (KeyManager.isDown(69))
							{
								var movetype = DroneObject.DRONEMOVE_SURFACEFOLLOW_CW;
							}
							else if (KeyManager.isDown(87))
							{
								var movetype = DroneObject.DRONEMOVE_WANDER_ALTERNATING;
							}
							else if (KeyManager.isDown(83))
							{
								var movetype = DroneObject.DRONEMOVE_WANDER_RANDOM;
							}
							else if (KeyManager.isDown(65))
							{
								var movetype = DroneObject.DRONEMOVE_WANDER_CCW;
							}
							else if (KeyManager.isDown(68))
							{
								var movetype = DroneObject.DRONEMOVE_WANDER_CW;
							}
							else
							{
								return;
							}
							this.editObjStepVar0 = movetype;
							this.editObjStep = 1;
							this.pointer.objhelp.gotoAndStop(23);
							return;
						}
						else if (this.editObjStep == 1)
						{
							if (KeyManager.isDown(68))
							{
								var dir = DroneObject.AI_DIR_R;
							}
							else if (KeyManager.isDown(65))
							{
								var dir = DroneObject.AI_DIR_L;
							}
							else if (KeyManager.isDown(87))
							{
								var dir = DroneObject.AI_DIR_U;
							}
							else if (KeyManager.isDown(83))
							{
								var dir = DroneObject.AI_DIR_D;
							}
							else
							{
								this.editObjStep = 0;
								this.pointer.objhelp.gotoAndStop(16);
								return;
							}
							this.editObjStepVar1 = dir;
							this.editObjStep = 2;
							params[2] = this.editObjStepVar0;
							params[3] = ischase;
							params[4] = DroneObject.DRONEWEAP_LASER;
							params[5] = this.editObjStepVar1;
							this.pointer.objhelp.gotoAndStop(16);
							_local3 = 6;
						}
					}
					else if (this.currentEOBJTYPE == NinjaEditor.EOBJTYPE_CHAINGUNDRONE)
					{
						if (this.editObjStep == 0)
						{
							if (KeyManager.isDown(81))
							{
								var movetype = DroneObject.DRONEMOVE_SURFACEFOLLOW_CCW;
							}
							else if (KeyManager.isDown(69))
							{
								var movetype = DroneObject.DRONEMOVE_SURFACEFOLLOW_CW;
							}
							else if (KeyManager.isDown(87))
							{
								var movetype = DroneObject.DRONEMOVE_WANDER_ALTERNATING;
							}
							else if (KeyManager.isDown(83))
							{
								var movetype = DroneObject.DRONEMOVE_WANDER_RANDOM;
							}
							else if (KeyManager.isDown(65))
							{
								var movetype = DroneObject.DRONEMOVE_WANDER_CCW;
							}
							else if (KeyManager.isDown(68))
							{
								var movetype = DroneObject.DRONEMOVE_WANDER_CW;
							}
							else
							{
								return;
							}
							this.editObjStepVar0 = movetype;
							this.editObjStep = 1;
							this.pointer.objhelp.gotoAndStop(25);
							return;
						}
						else if (this.editObjStep == 1)
						{
							if (KeyManager.isDown(68))
							{
								var dir = DroneObject.AI_DIR_R;
							}
							else if (KeyManager.isDown(65))
							{
								var dir = DroneObject.AI_DIR_L;
							}
							else if (KeyManager.isDown(87))
							{
								var dir = DroneObject.AI_DIR_U;
							}
							else if (KeyManager.isDown(83))
							{
								var dir = DroneObject.AI_DIR_D;
							}
							else
							{
								this.editObjStep = 0;
								this.pointer.objhelp.gotoAndStop(17);
								return;
							}
							this.editObjStepVar1 = dir;
							this.editObjStep = 2;
							if (KeyManager.isDown(32))
							{
								var ischase = 1;
							}
							else
							{
								var ischase = 0;
							}
							params[2] = this.editObjStepVar0;
							params[3] = ischase;
							params[4] = DroneObject.DRONEWEAP_CHAINGUN;
							params[5] = this.editObjStepVar1;
							this.pointer.objhelp.gotoAndStop(17);
							_local3 = 6;
						}
					}
					else
					{
						_local3 = 2;
					}
					this.CreateObject(this.currentOBJTYPE, params, _local3, this.currentEOBJTYPE);
				}
			}
		}

		public function KillMostRecentObj():void
		{
			var _local1 = this.objList.pop();
			Main.getInstance().gfx.DestroyMC(_local1[NinjaEditor.EDITRECORD_MC]);
			Main.getInstance().gfx.DestroyMC(_local1[NinjaEditor.EDITRECORD_MC2]);
		}

		public function KillNearestObj(p):void
		{
			var c = Main.getInstance().tiles.GetTile_S(p.x, p.y);
			var ci = c.i;
			var cj = c.j;
			var temp = null;
			var dist = 10000000;
			var nearesti = -1;
			var oList = this.objList;
			for (var i in oList)
			{
				var obj = oList[i];
				var _local3 = obj[NinjaEditor.EDITRECORD_POS].x - p.x;
				var _local2 = obj[NinjaEditor.EDITRECORD_POS].y - p.y;
				var _local1 = (_local3 * _local3) + (_local2 * _local2);
				if (300 < _local1)
				{
					continue;
				}
				if (_local1 < dist)
				{
					nearesti = i;
					temp = obj;
					dist = _local1;
				}
			}
			if (temp != null)
			{
				var obj = this.objList.splice(nearesti, 1);
				Main.getInstance().gfx.DestroyMC(temp[NinjaEditor.EDITRECORD_MC]);
				Main.getInstance().gfx.DestroyMC(temp[NinjaEditor.EDITRECORD_MC2]);
				temp = null;
			}
		}

		public function SpawnGameObjects():void
		{
			var _local3 = -1;
			for (var _local1 in this.objList)
			{
				if (this.objList[_local1][NinjaEditor.EDITRECORD_TYPE] == ObjectManager.OBJTYPE_PLAYER)
				{
					_local3 = _local1;
					break;
				}
			}
			if (_local3 < 0)
			{
			}
			else
			{
				var p = this.objList[_local3];
				this.objList.splice(_local3, 1);
				this.objList.splice(0, 0, p);
			}
			Main.getInstance().objects.Clear();
			var _local1 = 0;
			while (_local1 < this.objList.length)
			{
				Main.getInstance().objects.SpawnGameObject(this.objList[_local1][NinjaEditor.EDITRECORD_TYPE], this.objList[_local1][NinjaEditor.EDITRECORD_PARAMS]);
				_local1++;
			}
		}

		public function BuildEditObj(OBJTYPE, params):void
		{
			var _local2 = OBJTYPE;
			var _local3 = params;
			var _local1 = -1;
			if (_local2 == ObjectManager.OBJTYPE_GOLD)
			{
				_local1 = NinjaEditor.EOBJTYPE_GOLD;
			}
			else if (_local2 == ObjectManager.OBJTYPE_BOUNCEBLOCK)
			{
				_local1 = NinjaEditor.EOBJTYPE_BOUNCEBLOCK;
			}
			else if (_local2 == ObjectManager.OBJTYPE_LAUNCHPAD)
			{
				_local1 = NinjaEditor.EOBJTYPE_LAUNCHPAD;
			}
			else if (_local2 == ObjectManager.OBJTYPE_TURRET)
			{
				_local1 = NinjaEditor.EOBJTYPE_TURRET;
			}
			else if (_local2 == ObjectManager.OBJTYPE_FLOORGUARD)
			{
				_local1 = NinjaEditor.EOBJTYPE_FLOORGUARD;
			}
			else if (_local2 == ObjectManager.OBJTYPE_PLAYER)
			{
				_local1 = NinjaEditor.EOBJTYPE_PLAYER;
			}
			else if (_local2 == ObjectManager.OBJTYPE_MINE)
			{
				_local1 = NinjaEditor.EOBJTYPE_MINE;
			}
			else if (_local2 == ObjectManager.OBJTYPE_ONEWAYPLATFORM)
			{
				_local1 = NinjaEditor.EOBJTYPE_ONEWAYPLATFORM;
			}
			else if (_local2 == ObjectManager.OBJTYPE_THWOMP)
			{
				_local1 = NinjaEditor.EOBJTYPE_THWOMP;
			}
			else if (_local2 == ObjectManager.OBJTYPE_EXIT)
			{
				_local1 = NinjaEditor.EOBJTYPE_EXIT;
			}
			else if (_local2 == ObjectManager.OBJTYPE_HOMINGLAUNCHER)
			{
				_local1 = NinjaEditor.EOBJTYPE_HOMINGLAUNCHER;
			}
			else if (_local2 == ObjectManager.OBJTYPE_ONEWAYPLATFORM)
			{
				_local1 = NinjaEditor.EOBJTYPE_ONEWAYPLATFORM;
			}
			else if (_local2 == ObjectManager.OBJTYPE_TESTDOOR)
			{
				if ((_local3[3] == 1) && (_local3[6] == 0))
				{
					_local1 = NinjaEditor.EOBJTYPE_TRAPDOOR;
				}
				else if ((_local3[3] == 0) && (_local3[6] == 1))
				{
					_local1 = NinjaEditor.EOBJTYPE_LOCKDOOR;
				}
				else if ((_local3[3] == 0) && (_local3[6] == 0))
				{
					_local1 = NinjaEditor.EOBJTYPE_TREKDOOR;
				}
				else
				{
					return;
				}
			}
			else if (_local2 == ObjectManager.OBJTYPE_DRONE)
			{
				if (_local3[4] == DroneObject.DRONEWEAP_ZAP)
				{
					_local1 = NinjaEditor.EOBJTYPE_ZAPDRONE;
				}
				else if (_local3[4] == DroneObject.DRONEWEAP_LASER)
				{
					_local1 = NinjaEditor.EOBJTYPE_LASERDRONE;
				}
				else if (_local3[4] == DroneObject.DRONEWEAP_CHAINGUN)
				{
					_local1 = NinjaEditor.EOBJTYPE_CHAINGUNDRONE;
				}
				else
				{
					return;
				}
			}
			else
			{
				return;
			}
			this.CreateObject(_local2, _local3, _local3.length, _local1);
		}

		//
		public static const EDITRECORD_TYPE:int = 0;
		public static const EDITRECORD_PARAMS:int = 1;
		public static const EDITRECORD_POS:int = 2;
		public static const EDITRECORD_CELLI:int = 3;
		public static const EDITRECORD_CELLJ:int = 4;
		public static const EDITRECORD_MC:int = 5;
		public static const EDITRECORD_MC2:int = 6;

		public function CreateObject(OBJTYPE, params, plen, EOBJTYPE):void
		{
			var _local3 = params;
			this.editObjStep = 0;
			this.objnum++;
			var px = _local3[0];
			var py = _local3[1];
			var c = Main.getInstance().tiles.GetTile_S(px, py);
			var ci = c.i;
			var cj = c.j;
			var _local2 = new Array();
			_local2[NinjaEditor.EDITRECORD_TYPE] = OBJTYPE;
			_local2[NinjaEditor.EDITRECORD_PARAMS] = new Array();
			var _local1 = 0;
			while (_local1 < plen)
			{
				_local2[NinjaEditor.EDITRECORD_PARAMS][_local1] = _local3[_local1];
				_local1++;
			}
			_local2[NinjaEditor.EDITRECORD_POS] = new Vector2(px, py);
			_local2[NinjaEditor.EDITRECORD_CELLI] = ci;
			_local2[NinjaEditor.EDITRECORD_CELLJ] = cj;
			var mc = Main.getInstance().gfx.CreateSprite("editorObjMC", NinjaGraphicsSystem.LAYER_EDITOR);
			_local2[NinjaEditor.EDITRECORD_MC] = mc;
			var mc2 = Main.getInstance().CreateMC("EMPTY_MC", ("obj" + OBJTYPE) + this.objnum);
			_local2[NinjaEditor.EDITRECORD_MC2] = mc2;
			this.objList.push(_local2);
			this.DrawObject(_local2, EOBJTYPE);
		}

		public function DrawObject(defList, EOBJ_TYPE):void
		{
			var pos = defList[NinjaEditor.EDITRECORD_POS];
			var _local2 = defList[NinjaEditor.EDITRECORD_PARAMS];
			var ci = defList[NinjaEditor.EDITRECORD_CELLI];
			var cj = defList[NinjaEditor.EDITRECORD_CELLJ];
			var OBJ_TYPE = defList[NinjaEditor.EDITRECORD_TYPE];
			var _local3 = defList[NinjaEditor.EDITRECORD_MC];
			var _local1 = defList[NinjaEditor.EDITRECORD_MC2];
			_local3.gotoAndStop(EOBJ_TYPE + 1);
			_local3.x = pos.x;
			_local3.y = pos.y;
			_local3.scaleX = Main.getInstance().tiles.xw * 2;
			_local3.scaleY = Main.getInstance().tiles.yw * 2;
			_local1.clear();
			if (EOBJ_TYPE == NinjaEditor.EOBJTYPE_PLAYER)
			{
			}
			else if (EOBJ_TYPE == NinjaEditor.EOBJTYPE_GOLD)
			{
			}
			else if (EOBJ_TYPE == NinjaEditor.EOBJTYPE_BOUNCEBLOCK)
			{
			}
			else if (EOBJ_TYPE == NinjaEditor.EOBJTYPE_LAUNCHPAD)
			{
				_local1.lineStyle(2, 2237064, 100);
				_local1.moveTo(_local2[2] * 18, _local2[3] * 18);
				_local1.lineTo(0, 0);
				_local1.x = _local2[0];
				_local1.y = _local2[1];
				_local1.visible = true;
			}
			else if (EOBJ_TYPE == NinjaEditor.EOBJTYPE_TURRET)
			{
			}
			else if (EOBJ_TYPE == NinjaEditor.EOBJTYPE_FLOORGUARD)
			{
				_local1.lineStyle(2, 2237064, 100);
				_local1.moveTo(_local2[2] * 18, 0);
				_local1.lineTo(0, 0);
				_local1.x = _local2[0];
				_local1.y = _local2[1];
				_local1.visible = true;
			}
			else if (EOBJ_TYPE == NinjaEditor.EOBJTYPE_ZAPDRONE)
			{
				_local1.x = _local2[0];
				_local1.y = _local2[1];
				_local1.lineStyle(2, 2237064, 100);
				_local1.moveTo(0, 0);
				if (_local2[5] == DroneObject.AI_DIR_U)
				{
					_local1.lineTo(0, -18);
				}
				else if (_local2[5] == DroneObject.AI_DIR_L)
				{
					_local1.lineTo(-18, 0);
				}
				else if (_local2[5] == DroneObject.AI_DIR_R)
				{
					_local1.lineTo(18, 0);
				}
				else
				{
					_local1.lineTo(0, 18);
				}
				_local1.visible = true;
			}
			else if (EOBJ_TYPE == NinjaEditor.EOBJTYPE_LASERDRONE)
			{
				_local1.x = _local2[0];
				_local1.y = _local2[1];
				_local1.lineStyle(2, 2237064, 100);
				_local1.moveTo(0, 0);
				if (_local2[5] == DroneObject.AI_DIR_U)
				{
					_local1.lineTo(0, -18);
				}
				else if (_local2[5] == DroneObject.AI_DIR_L)
				{
					_local1.lineTo(-18, 0);
				}
				else if (_local2[5] == DroneObject.AI_DIR_R)
				{
					_local1.lineTo(18, 0);
				}
				else
				{
					_local1.lineTo(0, 18);
				}
				_local1.visible = true;
			}
			else if (EOBJ_TYPE == NinjaEditor.EOBJTYPE_CHAINGUNDRONE)
			{
				_local1.x = _local2[0];
				_local1.y = _local2[1];
				_local1.lineStyle(2, 2237064, 100);
				_local1.moveTo(0, 0);
				if (_local2[5] == DroneObject.AI_DIR_U)
				{
					_local1.lineTo(0, -18);
				}
				else if (_local2[5] == DroneObject.AI_DIR_L)
				{
					_local1.lineTo(-18, 0);
				}
				else if (_local2[5] == DroneObject.AI_DIR_R)
				{
					_local1.lineTo(18, 0);
				}
				else
				{
					_local1.lineTo(0, 18);
				}
				_local1.visible = true;
			}
			else if (EOBJ_TYPE == NinjaEditor.EOBJTYPE_ONEWAYPLATFORM)
			{
				if (_local2[2] == DroneObject.AI_DIR_D)
				{
					_local3.rotation = 180;
				}
				else if (_local2[2] == DroneObject.AI_DIR_L)
				{
					_local3.rotation = -90;
				}
				else if (_local2[2] == DroneObject.AI_DIR_R)
				{
					_local3.rotation = 90;
				}
			}
			else if (EOBJ_TYPE == NinjaEditor.EOBJTYPE_THWOMP)
			{
				if (_local2[2] == DroneObject.AI_DIR_U)
				{
					_local3.rotation = 180;
				}
				else if (_local2[2] == DroneObject.AI_DIR_L)
				{
					_local3.rotation = 90;
				}
				else if (_local2[2] == DroneObject.AI_DIR_R)
				{
					_local3.rotation = -90;
				}
			}
			else if (EOBJ_TYPE == NinjaEditor.EOBJTYPE_TREKDOOR)
			{
				var c = Main.getInstance().tiles.GetTile_I(_local2[4], _local2[5]);
				_local3.x = c.pos.x;
				_local3.y = c.pos.y;
				if (_local2[2] == 1)
				{
					if (_local2[8] == 0)
					{
						_local3.rotation = 90;
					}
					else
					{
						_local3.rotation = -90;
					}
				}
				else if (_local2[7] == 0)
				{
					_local3.rotation = 0;
				}
				else
				{
					_local3.rotation = 180;
				}
			}
			else if (EOBJ_TYPE == NinjaEditor.EOBJTYPE_TRAPDOOR)
			{
				var c = Main.getInstance().tiles.GetTile_I(_local2[4], _local2[5]);
				_local3.x = c.pos.x;
				_local3.y = c.pos.y;
				if (_local2[2] == 1)
				{
					if (_local2[8] == 0)
					{
						_local3.rotation = 90;
					}
					else
					{
						_local3.rotation = -90;
					}
				}
				else if (_local2[7] == 0)
				{
					_local3.rotation = 0;
				}
				else
				{
					_local3.rotation = 180;
				}
				_local1.lineStyle(4, 8921634, 100);
				_local1.moveTo(4, 4);
				_local1.lineTo(-4, -4);
				_local1.moveTo(4, -4);
				_local1.lineTo(-4, 4);
				_local1.x = _local2[0];
				_local1.y = _local2[1];
				_local1.visible = true;
			}
			else if (EOBJ_TYPE == NinjaEditor.EOBJTYPE_LOCKDOOR)
			{
				var c = Main.getInstance().tiles.GetTile_I(_local2[4], _local2[5]);
				_local3.x = c.pos.x;
				_local3.y = c.pos.y;
				if (_local2[2] == 1)
				{
					if (_local2[8] == 0)
					{
						_local3.rotation = 90;
					}
					else
					{
						_local3.rotation = -90;
					}
				}
				else if (_local2[7] == 0)
				{
					_local3.rotation = 0;
				}
				else
				{
					_local3.rotation = 180;
				}
				_local1.lineStyle(4, 2237064, 100);
				_local1.moveTo(4, 4);
				_local1.lineTo(-4, -4);
				_local1.moveTo(4, -4);
				_local1.lineTo(-4, 4);
				_local1.x = _local2[0];
				_local1.y = _local2[1];
				_local1.visible = true;
			}
			else if (EOBJ_TYPE == NinjaEditor.EOBJTYPE_HOMINGLAUNCHER)
			{
			}
			else if (EOBJ_TYPE == NinjaEditor.EOBJTYPE_EXIT)
			{
				_local1.lineStyle(4, 2263074, 100);
				_local1.moveTo(4, 4);
				_local1.lineTo(-4, -4);
				_local1.moveTo(4, -4);
				_local1.lineTo(-4, 4);
				_local1.x = _local2[2];
				_local1.y = _local2[3];
				_local1.visible = true;
			}
			else if (EOBJ_TYPE == NinjaEditor.EOBJTYPE_MINE)
			{
				return;
			}
		}
	}
}